const Router = require('koa-router');
const router = new Router();

/**
* @swagger
* tags:
*   name: ljf
*   description: 李金福业主后台
*/

/**
* @swagger
* components:
*   schemas:
*     data:
*       type: object
*       properties:
*         id:
*           type: integer
*           description: The user ID.
*         name:
*           type: string
*           description: The user's name.
*       ledger:
*           type: integer
*           description: The user ledger.
 *           status:
*           type: text
*           description: The user status.
*          todesk:
*           type: text
*           description: The user todesk.
*       required:
*         - id
*         - name
*         - ledger
*         - status
*         - todesk
*      
*/

/**
* @swagger
* 
/add:
*   post:
*     summary: 添加数据
*     tags: [Api]
*     responses:
*       200:
*         description: 全部查询
*         content:
*           application/json:
*             schema:
*               type: array
*               items:
*                 $ref: '#/components/schemas/Api'
 /query:
*   get:
*     summary: 全部查询
*     tags: [Api]
*     responses:
*       200:
*         description: 全部查询
*         content:
*           application/json:
*             schema:
*               type: array
*               items:
*                 $ref: '#/components/schemas/Api'
 /edit:
*   get:
*     summary: 修改数据
*     tags: [Api]
*     responses:
*       200:
*         description: 修改数据
*         content:
*           application/json:
*             schema:
*               type: array
*               items:
*                 $ref: '#/components/schemas/Api'
 /del:
*   get:
*     summary: 删除数据
*     tags: [Api]
*     responses:
*       200:
*         description: 删除数据
*         content:
*           application/json:
*             schema:
*               type: array
*               items:
*                 $ref: '#/components/schemas/Api'
 /query/:id:
*   get:
*     summary: 根据id查询制定的数据
*     tags: [Api]
*     responses:
*       200:
*         description: 根据id查询制定的数据
*         content:
*           application/json:
*             schema:
*               type: array
*               items:
*                 $ref: '#/components/schemas/Api'
 
*/

router.get('/users', async (ljf) => {
    const users = [
        { id: 1, name: 'John Doe' },
        { id: 2, name: 'Jane Doe' },
    ];
    ctx.body = ljf;
});

module.exports = router;

